<template>
  <div>
    <!-- 商品分类组件 -->
    <TypeNav></TypeNav>
    <List />>
    <!-- 今日推荐组件 -->
    <Recommend></Recommend>
    <!--  -->
    <Rank></Rank>
    <!-- 猜你喜欢组件 -->
    <Like></Like>
    <!-- 楼层组件 -->
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor"></Floor>
    <!-- 商标组件 -->
    <Brand></Brand>
  </div>
</template>

<script>
import Recommend from './recommend/Recommend.vue';
import List from './List';
import Rank from './rank/Rank.vue';
import Like from './like/Like.vue';
import Floor from './floor/Floor.vue';
import Brand from './brand/Brand.vue';



import { mapState } from 'vuex';
export default {
  name: 'Home',
  components: { Recommend, Rank, Like, Floor, Brand, List },
  mounted() {
    // 通知vuex发请求获取b楼层轮播图数据
    this.$store.dispatch('getfloor')
  },
  computed: {
    ...mapState({
      floorList: state => state.Home.floorList
    })
  }
};
</script>

<style scoped></style>